<template>
  <div>
<table class="table table-bordered">
  <tr>
    <td>id</td>
    <td>账号</td>
    <td>密码</td>
    <td>注册时间</td>
  </tr>
  <tr v-for="item in list">
    <td>{{item.userId}}</td>
    <td>{{item.userName}}</td>
    <td>{{item.userPwd.substr(0,4)}}***</td>
    <td>{{item.userData.substr(0,10)}}</td>
  </tr>
</table>
  </div>
</template>

<script setup lang="ts">
import {reactive,toRefs,onMounted} from  'vue'
import axios from 'axios'
import { useRoute,useRouter } from 'vue-router';
const router=useRouter()
const route=useRoute()

let data:any=reactive({
   list:[],
})

let {list}=toRefs(data)

onMounted(()=>{
  show()
})

const show=()=>{
  axios({
    url:'/api/Users/GetUserShow',
    method:'get',
    params:list.value
  })
  .then(res=>{
    console.log(res.data);
    list.value=res.data.data
    console.log(res.data.data.length);
  })
  .catch(err=>{
    console.log(err);
    
  })

}
</script>

<style scoped>

</style>